<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/12/5 0005
  Time: 15:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div>
    ${param.studentname}
    <%--${paramValues.from}--%>
    <br/>来源：
    <c:forEach items="${paramValues.from}" var="f">
        ${f}
    </c:forEach>
</div>
<hr size="40"/>
<%
    request.setCharacterEncoding("utf-8");
    String ip=request.getRemoteHost();
    String sname=request.getParameter("studentname");
    String pass=request.getParameter("pass");
    String p=request.getParameter("phone");
    String[]from=request.getParameterValues("from");//有可能null
%>
<h1>
    ip:<%=ip%>
</h1>
<h1>
    姓名:<%=sname%>
</h1>
<h1>
    密码:<%=pass%>
</h1>
<h1>
    电话:<%=p%>
</h1>
<%
    for(int i=0;from!=null&&i<from.length;i++)
         out.print(from[i]+"&nbsp;");
%>

<%--<%
    //
    //用户名和密码的长度超过6位，认为注册成功，显示out.jsp中的内容
    //方法1：拷贝
    //2:跳转过去
    if(sname.length()>=2&&pass.length()>=6){
        response.sendRedirect("out.jsp");//重定向

        // request.getRequestDispatcher("out.jsp").forward(request,response);//转发
        return;
    }
    request.getRequestDispatcher("register.jsp").forward(request,response);//转发
    //request.getRe
   // out.print("填写信息不完整");
%>--%>
</body>
</html>
